<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<c:if test="${code==1}">
	<form id="pagerForm" method="post" action="web/admin/company/companyList?toResult=company_list">
		<input type="hidden" name="pageNum" value="${page.currentPage }" /> <input type="hidden" name="pageSize" value="${page.pageSize }" /> <input type="hidden" name="companyName" value="${companyName }" />
	</form>

	<form onsubmit="return navTabSearch(this);" action="web/admin/company/companyList?toResult=company_list" method="post">
		<div class="pageHeader">
			<input type="hidden" name="init" value=0>
			<div class="searchBar">
				<table class="searchContent">
					<tr>
						<td>公司名称: <input type="text" name="companyName" value="${companyName}" />
						</td>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td>
							<div class="buttonActive">
								<div class="buttonContent">
									<button type="submit">检索</button>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="pageContent">
			<div class="panelBar">
				<ul class="toolBar">
					<li><a class="add" href="web/admin/company/companyList?toResult=company_add" target="navTab" rel="company_add"><span>添加</span></a></li>
					<li class="line">line</li>
					<li><a class="edit" href="web/admin/company/companyList?toResult=company_update&companyId={sid_support}" target="navTab" rel="company_update"><span>编辑</span> </a></li>
					<li class="line">line</li>
					<li><a class="delete" href="web/admin/company/companyList?toResult=company_delete&companyId={sid_support}" target="ajaxTodo" title="确认删除吗？"><span>删除</span> </a></li>
				</ul>
			</div>

			<table class="list" width="150%" layoutH="138">
				<thead>
					<tr>
						<th width="2%" align="center">序号</th>
						<th width="5%" align="center">公司名称</th>
						<th width="5%" align="center">公司座机</th>
						<th width="5%" align="center">销售代表</th>
						<th width="5%" align="center">邮箱</th>
						<th width="5%" align="center">地址</th>
						<th width="5%" align="center">公司性质</th>
						<th width="5%" align="center">营业执照</th>
						<th width="5%" align="center">税务登记证</th>
						<th width="5%" align="center">组织代码证</th>
						<th width="5%" align="center">账号状态</th>
						<th width="5%" align="center">创建时间</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.data}" var="company" varStatus="st">
						<tr target="sid_support" rel="${company.companyId}">
							<th align="center">${st.count}</th>
							<th align="center">${company.companyName}</th>
							<th align="center">${company.companyPhone}</th>
							<th align="center">${company.companySale}</th>
							<th align="center">${company.companyMail}</th>
							<th align="center">${company.companyAdd}</th>
							<th align="center">${company.companyType}</th>
							<th align="center">${company.companyLicense}</th>
							<th align="center">${company.companyTax}</th>
							<th align="center">${company.companyCode}</th>
							<th align="center">
							<c:choose>
								<c:when test="${company.companyEnable}">启用</c:when>
								<c:otherwise>禁用</c:otherwise>
							</c:choose></th>
							<th align="center"><fmt:formatDate value="${company.createTime}" pattern="yyyy/MM/dd  HH:mm:ss" /></th>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div class="panelBar">
				<div class="pages">
					<span>共${page.totalNum }条，共${page.totalPage }页</span>
				</div>
				<div class="pagination" targetType="navTab" totalCount="${page.totalNum }" numPerPage="${page.pageSize }" pageNumShown="10" currentPage="${page.currentPage }"></div>
			</div>
		</div>
	</form>
</c:if>
<c:if test="${code==0}">
	${message}
</c:if>